//
//  SXYSNewsMainCell.m
//  ShiXun
//
//  Created by lanou on 15/10/28.
//  Copyright © 2015年 张琪. All rights reserved.
//

#import "SXYSNewsMainCell.h"
#import "UIImageView+WebCache.h"
@implementation SXYSNewsMainCell
- (void)setConfigureModel:(SXYSNewsMainModel *)configureModel
{
    _configureModel = configureModel;
    [_coverImg sd_setImageWithURL:[NSURL URLWithString:configureModel.cl_image] placeholderImage:[UIImage imageNamed:@"SX-placeholder"]];
    _titleLabel.text = configureModel.title;

}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _coverImg = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, kScreenWidth - 10, (kScreenWidth - 10) * 183 / 320)];
        _coverImg.userInteractionEnabled = YES;
        [self.contentView addSubview:_coverImg];
        UILabel *backLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, (kScreenWidth - 10) * 183 / 320 - 40, kScreenWidth - 10, 40)];
        backLabel.backgroundColor = [UIColor colorWithWhite:0.500 alpha:0.604];
        [_coverImg addSubview:backLabel];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, (kScreenWidth - 10) * 183 / 320 - 40, kScreenWidth - 30, 40)];
        _titleLabel.font = [UIFont systemFontOfSize:13];
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.numberOfLines = 2;
        [_coverImg addSubview:_titleLabel];
    }
    return self;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
